package com.yiren.manager.service.impl.pension;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yiren.core.exception.MyException;
import com.yiren.core.service.GenericServiceImpl;
import com.yiren.core.utils.Favorites;
import com.yiren.entity.YrCaregiverSendOrdersStandard;
import com.yiren.entity.YrCaregiverSendOrdersStandardHistory;
import com.yiren.manager.repository.pension.YrCaregiverSendOrdersStandardHistoryRepository;
import com.yiren.manager.repository.pension.YrCaregiverSendOrdersStandardRepository;
import com.yiren.manager.service.iface.pension.YrCaregiverSendOrdersStandardService;

@Service("yrCaregiverSendOrdersStandardService")
public class YrCaregiverSendOrdersStandardServiceImpl extends GenericServiceImpl<YrCaregiverSendOrdersStandard, String> implements YrCaregiverSendOrdersStandardService{
	
	@Autowired
	private YrCaregiverSendOrdersStandardHistoryRepository historyRepository;
	
	@Autowired
	public YrCaregiverSendOrdersStandardServiceImpl(
			YrCaregiverSendOrdersStandardRepository repository) {
		super(repository);
	}

	public void addByFavorites(Favorites entitys) throws MyException {
		YrCaregiverSendOrdersStandard enetity = entitys.getFavorite(YrCaregiverSendOrdersStandard.class);
		YrCaregiverSendOrdersStandardHistory history = entitys.getFavorite(YrCaregiverSendOrdersStandardHistory.class);
	
		this.repository.save(enetity);
		historyRepository.save(history);
	}

	public void modifyByFavorites(Favorites entitys) throws MyException {
		// TODO Auto-generated method stub
		
	}

}
